<template>
  <div class="page">
    <!-- 表单 -->

    <a-card>
      <com-vxe-table
        :columns="columns"
        :axios="page"
        :fromItem="fromItem"
        :formData="formData"
        :initialize="initialize"
        ref="xTable"
      >
        <template #operate="data">
          <div>
            <vxe-button
              title="查看"
              status="primary"
              content="查看"
              @click="examine(data.row)"
            ></vxe-button>
          </div>
        </template>
      </com-vxe-table>
    </a-card>
    <register ref="registerRef" :processingData="processingData"/>
  </div>
</template>

<script>
//流程接口
import { flowJkPage,queryJobByJobId } from "../../api/yearCheck";
import comVxeTable from "@/views/everydayCheck/components/vxe-table/com-vxe-table";
import register from '@/views/assessmentExamination/register/register'
export default {
  components: { comVxeTable, flowJkPage, register },
  name: "dengjiPage",
  props: {
    fywflcode: {
      type: String,
      default: "",
    },
  },
  data() {
    return {
      processingData:{},
      columns: [
        {
          type: "checkbox",
        },
        {
          type: "seq",
          title: "序号",
          width: "60",
        },
        {
          field: "fgzdw",
          title: "工作单位",
          width: "150",
        },
        {
          field: "fyear",
          title: "年度",
          width: "150",
        },
        {
          field: "fzjkssj",
          title: "总结开始时间",
          width: "150",
        },
        {
          field: "fzjjssj",
          title: "总结结束时间",
          width: "150",
        },
        {
          field: "fusermc",
          title: "用户名称",
          width: "150",
        },
        {
          field: "fhjmc",
          title: "环节名称",
          width: "150",
        },
        {
          field: "ffsrmc",
          title: "发送人",
          width: "150",
        },
        {
          field: "ffssj",
          title: "发送时间",
          width: "150",
        },
        {
          field: "fdbr",
          title: "待办人",
          width: "150",
        },
        {
          field: "fblzt",
          title: "办理状态",
          width: "150",
        },
        {
          title: "操作",
          field: "operate",
          width: 200,
          slots: { default: "operate", fixed: "right" },
        },
      ],
      queryParams: {},
      config: {},
      data: [],
      allAlign: null,
      formData: {
        fsxmc: "",
        fqymc: "",
        fslsj: "",
        fjzrq: "",
      },
      fromItem: [
        
        {
          field: "fhjmc",
          title: "环节名称",
          type: "input",
          itemRender: {},
          slots: { default: "name_item" },
        },
        {
          field: "fgzdw",
          title: "工作单位",
          type: "input",
          itemRender: {},
          slots: { default: "name_item" },
        },
        {
          field: "fusermc",
          title: "用户名称",
          type: "input",
          itemRender: {},
          slots: { default: "name_item" },
        },
        {
          field: "fyear",
          title: "年度",
          type: "input",
          itemRender: {},
          slots: { default: "name_item" },
        },
        // {
        //   field: "fzjjssj",
        //   title: "总结开始时间",
        //   type:'datetime',
        //   itemRender: {},
        //   slots: { default: "name_item" },
        // },
        // {
        //   field: "fzjkssj",
        //   title: "总结结束时间",
        //   type:'datetime',
        //   itemRender: {},
        //   slots: { default: "name_item" },
        // },
      ],
      page: flowJkPage,
      initialize: {
        fywflcode: this.fywflcode,
        fblzt: "待办",
        // fhjmc: "待复核年度考评",
        onlyCurrentUser: false,
      },
      // fndszbg 填写 大文本
      form: {},
      model: {},
    };
  },
  created() {},
  mounted() {
    //console.log(this.initialize);
  },

  methods: {
    examine(row){//查看
      queryJobByJobId({jobid:row.jobid}).then(res=>{
        if(res.code == 200){
          this.$refs.registerRef.visibleShow = true
          //console.log(res)
          var data = res.result
          var HandledByOptions = []
          data.nextNodeDbrList.forEach(item => {
                  item = {
                      value:item.dbrid,
                      label:item.dbr
                  }
                  HandledByOptions.push(item)
              });
          this.processingData = {
              examine:1,
              fywflcode:this.fywflcode,
              jobid:row.jobid,
              fhjmc:data.job.fhjmc,
              nextNode:data.nextNode,
              dbrid:data.nextNodeDbrList.length?[data.nextNodeDbrList[0].dbrid]:[],
              dbridList:HandledByOptions,
              smgflag:false,
              fthyj:data.job.fthyj,
              ...data.ndkp,
          }
        }
      })
    }
  },
};
</script>

<style lang="less" scoped>
// @import "../assets/table.less";
@import url("../../assets/table.less");
</style>
